Knowledge Essentials - 3Essentials Hosting

$_SERVER['DOCUMENT_ROOT'] doesn't work on IIS

Article ID: 204

 Back to Search

This variable may not be present in IIS. Try the below work-around.

$DOCUMENT_ROOT = substr($_SERVER['PATH_TRANSLATED'],0,strlen($_SERVER['SCRIPT_NAME']) * - 1);
print($DOCUMENT_ROOT);

 

 
Downloads Associated With This Article
No downloads are currently associated with this article.